use tracing::{info, error, level_filters::LevelFilter, debug};
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, fmt::Layer, Layer as _};
use notify_server::get_router;


#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let layer = Layer::new().with_filter(LevelFilter::INFO);
    tracing_subscriber::registry().with(layer).init();
    let addr = "127.0.0.1:6687";

    let app = get_router();

    let listener = tokio::net::TcpListener::bind(&addr).await?;

    axum::serve(listener, app.into_make_service()).await?;

    Ok(())
}
